﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using BlueCMS.Core.Data.Query.Columns;

namespace BlueCMS.Core.Data.Query.Clauses
{
    public class GroupByClause : IGroupByClause
    {
        public List<Column> GroupByColumns { get; private set; }

        public GroupByClause()
        {
            GroupByColumns = new List<Column>();
        }

        public IGroupByClause Columns(params object[] namesOrExpressions)
        {
            foreach (object nameOrExpression in namesOrExpressions)
            {
                Column column = new Column(nameOrExpression);
                GroupByColumns.Add(column);
            }
            return this;
        }
    }
}
